﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WCS.Infrastructure.Dto.Common;

namespace WCS.Infrastructure.Dto.Request.Organization
{
    /// <summary>
    /// 用户角色关联表
    /// </summary>
    public class UserRoleRequestDto:BaseRequestDto
    {
        /// <summary>
        /// 关联ID
        /// </summary>
        [Key]
        [StringLength(32)]
        public string? Id { get; set; } = null!;

        /// <summary>
        /// 角色昵称
        /// </summary>
        [StringLength(255)]
        public string? Name { get; set; }

        /// <summary>
        /// 用户ID
        /// </summary>
        [StringLength(32)]
        public string? UserId { get; set; } = null!;

        /// <summary>
        /// 角色ID
        /// </summary>
        [StringLength(32)]
        public string? RoleId { get; set; } = null!;

        /// <summary>
        /// 所属商户ID
        /// </summary>
        [StringLength(32)]
        public string? MerchantId { get; set; } = null!;

        /// <summary>
        /// 所属门店ID
        /// </summary>
        [StringLength(32)]
        public string? StoreId { get; set; }

        /// <summary>
        /// 扩展属性
        /// </summary>
        public string? ExtraProperties { get; set; }

        /// <summary>
        /// 并发标记
        /// </summary>
        [StringLength(255)]
        public string? ConcurrencyStamp { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column(TypeName = "timestamp(6) without time zone")]
        public DateTime? CreationTime { get; set; }

        /// <summary>
        /// 创建人ID
        /// </summary>
        [StringLength(32)]
        public string? CreatorId { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        [Column(TypeName = "timestamp(6) without time zone")]
        public DateTime? LastModificationTime { get; set; }

        /// <summary>
        /// 最后修改人ID
        /// </summary>
        [StringLength(32)]
        public string? LastModifierId { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        public bool? IsDeleted { get; set; }

        /// <summary>
        /// 删除者ID
        /// </summary>
        [StringLength(32)]
        public string? DeleterId { get; set; }

        /// <summary>
        /// 删除时间
        /// </summary>
        [Column(TypeName = "timestamp(6) without time zone")]
        public DateTime? DeletionTime { get; set; }

        /// <summary>
        /// 启用状态
        /// </summary>
        public int? EnableStatus { get; set; }

        /// <summary>
        /// 所属收款码ID
        /// </summary>
        [StringLength(32)]
        public string? CodeId { get; set; }

        //////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// 系统角色名称
        /// </summary>
        public string? RoleName { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        public string? Phone { get; set; }

        /// <summary>
        /// 验证码
        /// </summary>
        public string? Code { get; set; }

        /// <summary>
        /// 联系人名称
        /// </summary>
        public string? ContactPerson { get; set; }

        /// <summary>
        /// 联系人手机号
        /// </summary>
        public string? ContactPhone { get; set; }

        /// <summary>
        /// 用户手机号
        /// </summary>
        public string? UserPhone { get; set; }

        /// <summary>
        /// 商户名称
        /// </summary>
        public string? MerchantName { get; set; }

        /// <summary>
        /// 商户编号
        /// </summary>
        public string? MerchantCode { get; set; }

        /// <summary>
        /// 组织类型（0=平台，1=商户，2=门店）
        /// </summary>
        public int? OrganizationType { get; set; }

        /// <summary>
        /// 角色类型
        /// </summary>
        public int? RoleType { get; set; }

        /// <summary>
        /// 收款码名称
        /// </summary>
        public string? CodeName { get; set; }

        /// <summary>
        /// 门店名称
        /// </summary>
        public string? StoreName { get; set; }

        /// <summary>
        /// 目标门店ID集合（店长多店绑定）
        /// </summary>
        public List<string>? StoreIds { get; set; } = new List<string>();

        /// <summary>
        /// 目标收款码ID集合（收银员多码绑定）
        /// </summary>
        public List<string>? CodeIds { get; set; } = new List<string>();
    }
}
